#CMAKE VERSION
cmake_minimum_required(VERSION 3.3)
#PROJECT
project(D2ModSys14d LANGUAGES C CXX ASM_MASM)
#DLL
aux_source_directory(. DIR_LIB_SRCS)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR}/prebuild/Patched)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/prebuild/Patched)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${PROJECT_SOURCE_DIR}/prebuild/Patched)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${PROJECT_SOURCE_DIR}/prebuild/Patched)
include_directories(${PROJECT_SOURCE_DIR}/prebuild/Patched)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)

if (MSVC)
    set(CompilerFlags
        CMAKE_CXX_FLAGS
        CMAKE_CXX_FLAGS_DEBUG
        CMAKE_CXX_FLAGS_RELEASE
        CMAKE_C_FLAGS
        CMAKE_C_FLAGS_DEBUG
        CMAKE_C_FLAGS_RELEASE
        )
    foreach(CompilerFlag ${CompilerFlags})
        string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
    endforeach()
endif(MSVC)

add_library (D2ModSys14d SHARED ${DIR_LIB_SRCS})

